package com.qf.springboot.mapper;

import com.qf.springboot.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {

    @Select("SELECT * FROM user WHERE id=#{id}")
    User findUserById(Long id);

    @Insert("INSERT INTO user (username,password,`type`,data2,data1)values(#{username},#{password},#{type},#{data2},#{data1})")
    void addUser(User user);

    @Update("UPDATE user type =#{type} WHERE id=#{id}")
    int updateUser(User user);

    @Update("UPDATE  user SET status=0 WHERE id in")
    int deleteUserById(Long id);


}
